package com.game;

import org.apache.log4j.Logger;

import com.common.utilities.SendData;
import com.game.utilities.CommandArguments;

/**
 * User: wattsc5
 * <p/>
 * Date: 2/28/12
 */
public class ClientCommandsAPI
{
	private static final Logger logger = Logger.getLogger(ClientCommandsAPI.class);

	private ClientGame game;

	/**
	 * Initializes a new instance of a ClientCommandsAPI.
	 * @param clientGame
	 */
	public ClientCommandsAPI(ClientGame clientGame)
	{
		this.game = clientGame;
	}

	public void bid(final CommandArguments commandArguments)
	{
		int diceCount = commandArguments.getArgumentAsInt(1);
		int diceValue = commandArguments.getArgumentAsInt(2);

		SendData sendData = new SendData();
		sendData.addArgument("bid");
		sendData.addArgument(diceCount);
		sendData.addArgument(diceValue);
		this.game.sendData(sendData);
	}

	public void challenge(final CommandArguments commandArguments)
	{
		SendData sendData = new SendData();
		sendData.addArgument("challenge");
		this.game.sendData(sendData);
	}

	public void quit(final CommandArguments commandArguments)
	{
		this.game.quit();
	}
}
